# define _CRT_SECURE_NO_WARNINGS
# define N 3
# include <stdio.h>
int main()
{
	int a[2 * N] = { 0 };
	int i = 0;
	for (i = 0; i < N; i++)
	{
		scanf("%d %d", &a[2 * i], &a[2 * i + 1]);
	}
	int max = a[0] / a[1];
	int j;
	for (j = 1; j < N; j++)
	{
		if ((a[2 * j] / a[2 * j + 1])<max)
		{
			max = a[2 * j] / a[2 * j + 1];
		}
	}
	int min = (a[0] / (a[1] + 1)) + 1;
	int k;
	for ( k= 1; k < N; k++)
	{
		if ((a[2 * k] / (a[2 * k+1] + 1)) + 1 > min)
		{
			min = a[2 * k] / (a[2 * k+1] + 1) + 1;
		}
	}
	printf("%d %d", min, max);
	return 0;
}